
// new Vue({})

Page({
  data: {
    banner: [],
    meizi: []
  },
  previewImage(event) {
    // console.log(event.currentTarget.dataset.url)
    let imgArr = []
    this.data.banner.map(item => imgArr.push(item.image))
    wx.previewImage({
      current: event.currentTarget.dataset.url, // 当前显示图片的http链接
      urls: imgArr // 需要预览的图片http链接列表
    })
  },
  onLoad() {
    const self = this
    wx.request({
      method: 'GET',
      url: 'https://gank.io/api/v2/banners',
      success(res) {
        self.setData({
          banner: res.data.data
        })
        // console.log(self.data.banner)
        // self.data.banner = res.data
        // this.banner = res.data
        // console.log(self.data.banner)
      }
    })

    wx.request({
      method: 'GET',
      url: 'https://gank.io/api/v2/data/category/Girl/type/Girl/page/1/count/10',
      success(res) {
        self.setData({
          meizi: res.data.data
        })
      }
    })
  },
  bannerIndexChange(event) {
    // console.log(event.detail)
  }
})
